﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace UIFramework
{
    public class UIDepthItem_Canvas : UIDepthItem<Canvas>
    {
        public override void Init(string sortingLayer, Canvas component)
        {
            base.Init(sortingLayer, component);
            _component.overrideSorting = true;
            _component.sortingLayerName = _sortingLayerName;
            _originalOrder = _component.sortingOrder;
        }

        public override void ChangeDepth(int depthDelta)
        {
            _component.sortingOrder = _originalOrder + depthDelta;
        }
    }
}
